<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>封装自己的对象</title>
		<script type="text/javascript">
			var myMath = {
				PI:3.142342593,
				max:function() {
					var max = arguments[0];
					for(var i = 0; i < arguments.length; i++) {
						if(arguments[i] > max) {
							max = arguments[i];
						}
					}
					return max;
				},
				min:function() {
					var min = arguments[0];
					for(var i = 0; i < arguments.length; i++) {
						if(arguments[i] < min) {
							min = arguments[i];
						}
					}
					return min;
				}
			}
			console.log(myMath.max(1,2,3,4,5));
			console.log(myMath.min(1,2,3,4,5))
		</script>
	</head>
	<body>
	</body>
</html>
